function [long_bits] = old_Extract_process_2(sub_stego)
%UNTITLED3 此处显示有关此函数的摘要
%   此处显示详细说明
long_bits='';
bits='';
threshold=0.001;
dct_stego=blkproc(sub_stego,[2 2],@dct2);%2*2分块DCT2
for x=1:2
  for y=1:2
      extract_block=dct_stego((x-1)*2+1:x*2,(y-1)*2+1:y*2);%拿出每个2*2块
      bits=ext_bit(extract_block,threshold);
      long_bits=[long_bits bits];
  end
end
end

function sub_bits= ext_bit(extract_block,threshold)
sub_bits='';
short_bits='';
[y,Rin]=zigzag(extract_block,2);
for m=1:2
    a=abs(mydec(y(m+1)));%DCT系数的小数部分,取+
    T_1=abs(a-0.5);
    T_2=abs(a-1);
    T_3=abs(a);
    logical_1=T_1<threshold;%判定a=0.5
    logical_2=T_2<threshold || T_3<threshold;%判定a=0
    if            logical_2&&mod(abs(myround(y(m+1))),2)==0%LSB==0,并且a=0
        short_bits='00';
    elseif        logical_2&&mod(abs(myround(y(m+1))),2)==1%LSB==1,并且a=0
        short_bits='01';
    elseif        logical_1&&mod(abs(myround(y(m+1))),2)==0%LSB==0,并且a=0.5
        short_bits='10';
    elseif        logical_1&&mod(abs(myround(y(m+1))),2)==1%LSB==1,并且a=0.5
        short_bits='11';
    else
        short_bits='xx';
    end
    sub_bits=[sub_bits short_bits];
end
end
